home *** CD-ROM | disk | FTP | other *** search
/ AGA Toolkit '97 / The AGA Toolkit '97.iso / miscellaneous / science / maths / calc / help / todo < prev    next >
Encoding:
Text File  |  1996-09-07  |  7.7 KB  |  220 lines

  1. Needed enhancements
  2.  
  3.     Send calc comments, suggestions, bug fixes, enhancements and
  4.     interesting calc scripts that you would like you see included in
  5.     future distributions to:
  6.  
  7.         dbell@canb.auug.org.au
  8.         chongo@toad.com
  9.  
  10.     The following items are in the calc wish list.  Programs like this
  11.     can be extended and improved forever.
  12.  
  13.     *  Implement an autoload feature.  Associate a calc library filename
  14.        with a function or global variable.  On the first reference of
  15.        such item, perform an automatic load of that file.
  16.  
  17.     *  Use faster multiply and divide algorithms for large numbers.
  18.  
  19.     *  Add error handling statements, so that QUITs, errors from the 
  20.        'eval' function, division by zeroes, and so on can be caught.
  21.        This should be done using syntax similar to:
  22.  
  23.             ONERROR statement DO statement;
  24.  
  25.        Something like signal isn't versatile enough.
  26.  
  27.     *  Add a debugging capability so that functions can be single stepped,
  28.        breakpoints inserted, variables displayed, and so on.
  29.  
  30.     *  Figure out how to write all variables out to a file, including
  31.        deeply nested arrays, lists, and objects.
  32.  
  33.     *  Implement pointers.
  34.  
  35.     *  Eliminate the need for the define keyword by doing smarter parsing.
  36.  
  37.     *  Allow results of a command (or all commands) to be re-directed to a 
  38.        file or piped into a command.
  39.  
  40.     *  Add some kind of #include and #define facility.  Perhaps use
  41.        the C pre-processor itself?
  42.  
  43.     *  Allow one to undefine anything.  Allow one to test if anything
  44.        is defined.
  45.  
  46.     *  Support a more general input and output base mode other than
  47.        just dec, hex or octal.
  48.  
  49.     *  Implement a form of symbolic algebra.  Work on this has already
  50.        begun.  This will use backquotes to define expressions, and new
  51.        functions will be able to act on expressions.  For example:
  52.  
  53.            x = `hello * strlen(mom)`;
  54.         x = sub(x, `hello`, `hello + 1`);
  55.         x = sub(x, `hello`, 10, `mom`, "curds");
  56.         eval(x);
  57.  
  58.        prints 55.
  59.     
  60.     *  Place the results of previous commands into a parallel history list.
  61.        Add a binding that returns the saved result of the command so
  62.        that one does not need to re-execute a previous command simply
  63.        to obtain its value.
  64.  
  65.        If you have a command that takes a very long time to execute,
  66.        it would be nice if you could get at its result without having
  67.        to spend the time to reexecute it.
  68.  
  69.     *  Add a binding to delete a value from the history list.
  70.  
  71.        One may need to remove a large value from the history list if
  72.        it is very large.  Deleting the value would replace the history
  73.        entry with a null value.
  74.  
  75.     *  Add a binding to delete a command from the history list.
  76.  
  77.        Since you can delete values, you might as well be able to
  78.        delete commands.
  79.  
  80.     *  All one to alter the size of the history list thru config().
  81.  
  82.        In some cases, 256 values is too small, in others it is too large.
  83.  
  84.     *  Add a builtin that returns a value from the history list.
  85.        As an example:
  86.  
  87.         histval(-10)
  88.     
  89.        returns the 10th value on the history value list, if such 
  90.        a value is in the history list (null otherwise).  And:
  91.  
  92.         histval(23)
  93.     
  94.        return the value of the 23rd command given to calc, if
  95.        such a value is in the history list (null otherwise).
  96.  
  97.        It would be very helpful to use the history values in
  98.        subsequent equations.
  99.  
  100.     *  Add a builtin that returns command as a string from the
  101.        history list.  As an example:
  102.  
  103.         history(-10)
  104.     
  105.        returns a string containing the 10th command on the
  106.        history list, if a such a value is in the history list 
  107.        (empty string otherwise).  And:
  108.  
  109.         history(23)
  110.     
  111.        return the string containing the 23rd command given to calc, if
  112.        such a value is in the history list (empty string otherwise).
  113.  
  114.        One could use the eval() function to re-evaluate the command.
  115.  
  116.     *  Allow one to optionally restore the command number to calc 
  117.        prompts.  When going back in the history list, indicate the 
  118.        command number that is being examined.
  119.  
  120.        The command number was a useful item.  When one is scanning the
  121.        history list, knowing where you are is hard without it.  It can
  122.        get confusing when the history list wraps or when you use
  123.        search bindings.  Command numbers would be useful in
  124.        conjunction with positive args for the history() and histval()
  125.        functions as suggested above.
  126.  
  127.     *  Add a builtin that returns the current command number.
  128.        For example:
  129.  
  130.         cmdnum()
  131.  
  132.        returns the current command number.
  133.  
  134.        This would allow one to tag a value in the history list.  One
  135.        could save the result of cmdnum() in a variable and later use
  136.        it as an arg to the histval() or history() functions.
  137.  
  138.     *  Add a builtin to determine if an object as been defined.
  139.        For example:
  140.  
  141.         isobjdef("surd")
  142.  
  143.        would return true if one had previously defined the
  144.        surd object.  I.e., if "obj surd {...};" had been
  145.        executed.
  146.  
  147.        One cannot redefine an object.  If a script defines an object,
  148.        one cannot reload it without getting lots of already defined
  149.        errors.  If two scripts needed the same object, both could
  150.        define it and use isobjdef() to avoid redefinition problems.
  151.  
  152.     *  Add a builtin to determine if a function as been defined.
  153.        For example:
  154.  
  155.         isfunct("foo")
  156.  
  157.        would return true if foo has been defined as a function.
  158.  
  159.     *  Permit one to destroy an object.
  160.  
  161.        What if one does want to redefine an object?  Consider the case
  162.        where one it debugging a script and wants to reload it.  If
  163.        that script defines an object you are doomed.  Perhaps
  164.        destroying a object would undefine all of its related functions
  165.        and values?
  166.  
  167.     *  One some machines (such as the 486), floating point can be faster 
  168.        than integer arithmetic.  Often such floating point would allow
  169.        for a larger base than 2^16, allowing calc to run even faster.
  170.        Allow calc to take advantage of such hardware.
  171.     
  172.     *  Add NAN (Not A Number) to calc.  Where is it reasonable, change 
  173.        calc to process these values in way similar to that of the IEEE 
  174.        floating point.
  175.     
  176.     *  Add a factoring builtin functions.  Provide functions that perform 
  177.        multiple polynomial quadratic sieves, elliptic curve, difference 
  178.        of two squares, N-1 factoring as so on.  Provide a easy general 
  179.        factoring builtin (say factor(foo)) that would attempt to apply
  180.        whatever process was needed based on the value.
  181.  
  182.        Factoring builtins would return a matrix of factors.
  183.  
  184.        It would be handy to configure, via config(), the maximum time
  185.        that one should try to factor a number.  By default the time
  186.        should be infinite.  If one set the time limit to a finite
  187.        value and the time limit was exceeded, the factoring builtin
  188.        would return whatever if had found thus far, even if no new 
  189.        factors had been found.
  190.  
  191.        Another factoring configuration interface, via config(), that
  192.        is needed would be to direct the factoring builtins to return
  193.        as soon as a factor was found.
  194.  
  195.     *  Allow one to config calc break up long output lines.
  196.  
  197.        The command:  calc '2^100000'  will produce one very long
  198.        line.  Many times this is reasonable.  Long output lines
  199.        are a problem for some utilities.  It would be nice if one
  200.        could configure, via config(), calc to fold long lines.
  201.  
  202.        By default, calc should continue to produce long lines.
  203.  
  204.        One option to config should be to specify the length to
  205.        fold output.  Another option should be to append a trailing
  206.        \ on folded lines (as some symbolic packages use).
  207.  
  208.     *  Add scanf() and fscanf() functions.
  209.  
  210.        The scanf function should be able to handle both long lines
  211.        and split lines with trailing \'s.  It should also be able
  212.        to ignore the leading ~.
  213.  
  214.     *  Add the ability to read and write a value in some binary form.
  215.  
  216.        Clearly this is easy for non-neg integers.  The question of
  217.        everything else is worth pondering.
  218.     
  219.     *  Allow one to use the READ and WRITE commands inside a function.
  220.